<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta name="format-detection" content="telephone=no">
    <meta name="author" content="得闲技术 Team">
    <meta name="copyright" content="得闲技术">
    <title>操作日志列表 - Powered By 得闲技术</title>
    [#include "/admin/main/resources/list.ftl"/]
</head>
<body class="admin secondary">
<main>
    <div class="container-fluid">
        [#assign activeBreadcrumb= "操作日志"/]
        [#include  "/admin/main/breadcrumb.ftl"/]
        <form action="list" method="get">
            <div id="filterModal" class="modal fade" tabindex="-1" style="display: none;">
                <div class="modal-dialog">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button class="close" type="button" data-dismiss="modal">×</button>
                            <h5 class="modal-title">更多选项</h5>
                        </div>
                        <div class="modal-body form-horizontal">

                            <div class="form-group">
                                <label class="col-xs-2 control-label">功能模块:</label>
                                <div class="col-xs-10 col-sm-8">
                                    <select name="module" class="selectpicker form-control"title="请选择..." data-live-search="true" data-size="10" >
                                            [#include "/admin/admin/operate_log/admin_logs.ftl" /]
                                    </select>
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-xs-2 control-label">操作类型:</label>
                                <div class="col-xs-10 col-sm-8">
                                    <select name="operateType" class="selectpicker form-control">
                                        <option value="">请选择</option>
                                        [#list types as type]
                                            <option value="${type}" [#if form.operateType ==type]selected="selected"[/#if]>${message("OperateTypeEnum." + type)}</option>
                                        [/#list]
                                    </select>
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-xs-2 control-label">操作IP:</label>
                                <div class="col-xs-10 col-sm-8">
                                    <input id="ip" name="ip" class="form-control" type="text" value="${form.ip!}" />
                                </div>
                            </div>

                            [#include "/admin/main/resources/date_filter.ftl" /]
                        </div>
                        <div class="modal-footer">
                            <button class="btn btn-primary" type="submit">确 定</button>
                            <button class="btn btn-default reset-all" type="button">重 置</button>
                            <button class="btn btn-default" type="button" data-dismiss="modal">取 消</button>
                        </div>
                    </div>
                </div>
            </div>
            <div class="panel panel-default">
                <div class="panel-heading">
                    <div class="row">
                        <div class="col-xs-12 col-sm-7">
                            <div class="btn-group">
                                [@hasPermission name="operateLog:delete" ]
                                    <button class="btn btn-default" type="button" data-action="delete" disabled>
                                        <i class="iconfont icon-close"></i>删除
                                    </button>
                                [/@hasPermission]

                                <button class="btn btn-default" type="button" data-action="refresh">
                                    <i class="iconfont icon-refresh"></i>刷新
                                </button>
                                <button class="btn btn-default" type="button" data-toggle="modal"
                                        data-target="#filterModal">高级搜索
                                </button>
                                [#include "/admin/main/list/page_select.ftl" /]
                            </div>
                        </div>
                        <div class="col-xs-12 col-sm-5">
                            <div id="search" class="input-group">
                                <div class="input-group-btn">
                                    <button class="btn btn-default" type="button" data-toggle="dropdown">
                                        <span class="search-span">操作员</span>
                                        <span class="caret"></span>
                                    </button>
                                    <ul class="dropdown-menu">
                                        <li data-search-property="username">
                                            <a href="javascript:;">操作员</a>
                                        </li>
                                    </ul>
                                </div>
                                <input name="searchValue" class="form-control" type="text"
                                        value="${form.searchValue}" placeholder="搜 索"
                                        x-webkit-speech="x-webkit-speech" x-webkit-grammar="builtin:search">
                                <div class="input-group-btn">
                                    <button class="btn btn-default" type="submit">
                                        <i class="iconfont icon-search"></i>
                                        <span class="text-danger">[#if page??]${page.total!0}[#else]0[/#if]</span> 条 /
                                        <span class="text-danger">${page.totalPages!0}</span>页</span>
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="panel-body padding-10">
                    <div class="table-responsive">
                        <table class="table table-hover">
                            <thead>
                            <tr>
                                <th>
                                    <div class="checkbox">
                                        <input type="checkbox" data-toggle="checkAll">
                                        <label></label>
                                    </div>
                                </th>
                                <th>
                                    <a href="javascript:;" >
                                        耗时
                                    </a>
                                </th>
                                <th>
                                    <a href="javascript:;" data-order-property="username">
                                        操作员
                                        <i class="iconfont icon-biaotou-kepaixu"></i>
                                    </a>
                                </th>

                                <th>
                                    <a href="javascript:;" data-order-property="module">
                                        功能模块
                                        <i class="iconfont icon-biaotou-kepaixu"></i>
                                    </a>
                                </th>
                                <th>
                                    <a href="javascript:;" data-order-property="operateType">
                                        操作类型
                                        <i class="iconfont icon-biaotou-kepaixu"></i>
                                    </a>
                                </th>

                                <th>
                                    <a href="javascript:;" data-order-property="ip">
                                        操作IP
                                        <i class="iconfont icon-biaotou-kepaixu"></i>
                                    </a>
                                </th>
                                <th>
                                    <a href="javascript:;" data-order-property="browser">
                                        浏览器
                                        <i class="iconfont icon-biaotou-kepaixu"></i>
                                    </a>
                                </th>
                                <th>
                                    <a href="javascript:;" data-order-property="osName">
                                        操作系统
                                        <i class="iconfont icon-biaotou-kepaixu"></i>
                                    </a>
                                </th>
                                <th>
                                    <a href="javascript:;" data-order-property="deviceType">
                                        设备类型
                                        <i class="iconfont icon-biaotou-kepaixu"></i>
                                    </a>
                                </th>
                                <th>
                                    <a href="javascript:;" data-order-property="description">
                                        操作描述
                                        <i class="iconfont icon-biaotou-kepaixu"></i>
                                    </a>
                                </th>
                                <th>
                                    <a href="javascript:;" data-order-property="createDate">
                                        操作日期
                                        <i class="iconfont icon-biaotou-kepaixu"></i>
                                    </a>
                                </th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            [#list page.content as content]
                                <tr>
                                    <td>
                                        <div class="checkbox">
                                            <input name="ids" type="checkbox" value="${content.id}"
                                                    [#if !content.isAllowedDelete]disabled[/#if]><label></label>
                                        </div>
                                    </td>
                                    <td>
                                        ${content.endTimeMillis - content.beginTimeMillis} MS
                                    </td>
                                    <td>
                                        <a href="../admin/edit?id=${content.adminId}" target="_blank">
                                            ${content.username}
                                        </a>
                                    </td>
                                    <td>
                                        ${content.module}
                                    </td>
                                    <td>
                                        ${message("OperateTypeEnum." + content.operateType)}
                                    </td>
                                    <td>
                                        <a href="https://www.ip138.com/iplookup.asp?ip=${content.ip}&action=2"
                                                target="_blank" title="查看IP归属地" data-toggle="tooltip">
                                            ${content.ip}
                                        </a>
                                    </td>
                                    <td>
                                        ${content.browser}
                                        <p class="text-gray">
                                            ${content.browserVersion}
                                        </p>
                                    </td>
                                    <td>
                                        ${content.osName}
                                    </td>
                                    <td>
                                        ${content.deviceType}
                                    </td>
                                    <td>
                                        <a href="#" title="${content.operateUrl}" data-toggle="tooltip">
                                            ${content.description}
                                        </a>
                                    </td>
                                    <td>
                                        <span title="${(content.createDate?string(" yyyy-MM-dd HH:mm:ss"))!}"
                                                data-toggle="tooltip">${(content.createDate?string("yyyy-MM-dd"))!}</span>
                                    </td>
                                    <td>

                                        [@hasPermission name="operateLog:update" ]
                                            <a class="btn btn-default btn-xs btn-icon" href="update?id=${content.id}"
                                                    data-redirect-url="list">
                                                <i class="iconfont icon-search"></i> 查看
                                            </a>
                                        [/@hasPermission]

                                    </td>
                                </tr>
                            [/#list]
                            </tbody>
                        </table>
                    </div>
                </div>
                [@pagination pageNumber=page.pageNumber totalPages = page.totalPages]
                    [#include "/admin/main/list/pagination.ftl" /]
                [/@pagination]
            </div>
        </form>
    </div>
</main>
</body>
</html>
